package com.xyh.system.controller;


import com.xyh.common.util.ResultVO;
import com.xyh.system.model.LoginLog;
import com.xyh.system.service.ILoginLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * <p>
 * 登录日志表 前端控制器
 * </p>
 *
 * @author kyle
 * @since 2021-01-05
 */
@Controller
@RequestMapping("/loginLog")
public class LoginLogController {

    @Autowired
    private ILoginLogService loginLogService;
    /**
     *
     * 跳转到登录日志管理列表界面
     *
     * @return
     */
    @GetMapping("/index")
    public String toIndex() {
        System.out.println("=====LoginLogController.toIndex=====");
        return "log/loginLog";
    }

    @GetMapping("/list")
    @ResponseBody
    public ResultVO getList(Integer pageNumber, Integer pageSize, LoginLog loginLogQuery) {
        System.out.println("=====LoginLogController.getList=====");
        return ResultVO.success(loginLogService.getAllLoginLogByPage(pageNumber,pageSize,loginLogQuery));
    }

}
